package com.csxh.service;

import java.io.Serializable;
import java.util.List;

import com.csxh.IDao;
import com.csxh.bean.Menu;
import com.csxh.util.JdbcUtil;

public class MenuService implements IDao<Menu> {

	@Override
	public Menu findOne(Serializable id) {
	QueryService service =new QueryService();

		return service.from(Menu.class).where("id=?").params(id).one(Menu.class);
	}

	@Override
	public Menu findOne(String condition, Object... params) {
		QueryService service =new QueryService();
		return service.from(Menu.class).where(condition).params(params).one(Menu.class);
	}

	@Override
	public List<Menu> findAll(String condition, Object... params) {
		QueryService service =new QueryService();

		return service.from(Menu.class).where(condition).params(params).all(Menu.class);
	}

	@Override
	public boolean sava(Menu bean) {
		
		return JdbcUtil.add(bean);
	}

	@Override
	public boolean delete(Class<Menu> clazz, Serializable... ids) {
		boolean fok=false;
		for(Serializable id:ids){
			
		}
		return fok;
	}

	@Override
	public boolean updata(Menu bean) {
		return JdbcUtil.update(bean);
	}

	
}
